{% from "base/static.html" import static %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="csrf_token" content="{{csrf_token()}}">
    <title>{% block title %}title{% endblock %}</title>
    <script src="http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
    <link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="{{static('cms/css/cms_base.css')}}">
    <script src="{{static('cms/js/cms_base.js')}}"></script>
    {% block head %}{% endblock %}
</head>
<body>
     <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">知了课堂论坛CMS管理系统</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
            <li><a href="#">{{g.user.username}}<span>[超级管理员]</span></a></li>
            <li>
                <form action="{{url_for('cms.logout')}}" method="post" style="margin-top:2px;">
                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}">
                <input type="submit" class="btn btn-dark" value="删除">
            </form> </li>
          </ul>
          <form class="navbar-form navbar-right">
            <input type="text" class="form-control" placeholder="查找...">
          </form>
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
          <div class="col-sm-3 col-md-2 sidebar">
              <ul class="nav-sidebar">
                <li class="unfold"><a href="#">首页</a></li>
                <li class="profile-li">
                    <a href="#">个人中心<span></span></a>
                    <ul class="subnav">
                        {% if g.user.has_permission(cmsPermission.read) %}
                        <li><a href="{{url_for('cms.profile')}}">个人信息</a></li>
                        {% endif %}
                        {% if g.user.has_permission(cmsPermission.m_behind) %}
                        <li><a href="{{url_for('cms.resetpassword')}}">修改密码</a></li>
                        <li><a href="{{url_for('cms.resetmail')}}">修改邮箱</a></li>
                        {%endif%}
                    </ul>
                </li>
                  <!--<h1>{{cmsPermission}}</h1>-->
                  {% if g.user.has_permission(cmsPermission.ariticle) %}
                <li class="nav-group post-manage"><a href="{{url_for('cms.cms_article')}}">帖子管理</a></li>
                  {% endif %}
                  {% if g.user.has_permission(cmsPermission.talk) %}
                <li class="comments-manage"><a href="{{url_for('cms.cms_talk')}}">评论管理</a></li>
                  {%endif%}
                  {% if g.user.has_permission(cmsPermission.boader) %}
                <li class="board-manage"><a href="{{url_for('cms.cms_board')}}">板块管理</a></li>
                  {%endif%}
                  {% if g.user.has_permission(cmsPermission.m_front) and g.user.has_permission(cmsPermission.m_behind)%}

                <li class="nav-group user-manage"><a href="{{url_for('cms.people')}}">用户管理</a></li>
                <li class="role-manage"><a href="{{url_for('cms.group')}}">组管理</a></li>
                  {% endif%}

                {%if g.user.has_permission(cmsPermission.all)%}
                <li class="nav-group cmsuser-manage"><a href="{{url_for('cms.cms_people')}}">CMS用户管理</a></li>
                <li class="cmsrole-manage"><a href="{{url_for('cms.cms_group')}}">CMS组管理</a></li>
                {% endif%}
              </ul>
          </div>
          <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h1>{% block pagetitle %}{%endblock%}</h1>
            <div class="main_content">
                {% block content %}{%endblock%}
            </div>
          </div>
      </div>
    </div>
</body>
</html>